package com.neusoft.shopping.manager.controller;

import com.neusoft.shopping.manager.entity.DetailsEntity;
import com.neusoft.shopping.manager.service.DetailsServise;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
public class DetailsController {
    @Autowired
    DetailsServise servise ;
    @RequestMapping("/detail_show/{orderno}")
    public ModelAndView detail_show(@PathVariable("orderno") Integer orderno){
        ModelAndView modelAndView=new ModelAndView();
        List<DetailsEntity> details =servise.queryByOrderno(orderno);
        modelAndView.addObject("details",details);
        modelAndView.addObject("orderno",orderno);
        modelAndView.setViewName("detail_show");
        return modelAndView;
    }
}
